Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stackoverflow/stacks-icons

Package Overview
Dependencies
Maintainers
3
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stackoverflow/stacks-icons

The icon library for Stack Overflow, Stack Overflow Careers, and the Stack Exchange Network.

  • 1.35.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.6K
decreased by-4.94%
Maintainers
3
Weekly downloads
 
Created
Source

Icons

Icons

Introduction

This repo provides authoring tools for building Stack Overflow’s shared icon library. Here’s our general workflow:

  1. Open the Figma document to modify an existing icon, or add a new one. Pay close attention to the name of the newly-added artboard. This will determine your SVG’s filename.
  2. Export each artboard / component to the src directory. Since the artboards are prefixed with Icon, the final output directory will be src/Icon.
  3. Open this repo’s directory in Terminal, and type npm start. This will churn through the exported SVGs and build optimized SVGs in the build/lib directory. Some manifest files are included in build as well.

Installing dependencies

In order to use this repo, you must first install Node & NPM. Then, open this repo’s directory in your Terminal. Once you’re in this repo’s folder, type npm install. This will download all the dependencies.

Including Stacks Icons in your project

Stacks Icons are delivered via NPM. It can be installed with npm i @stackoverflow/stacks-icons

Using the front-end helper for prototyping

Note: This is not intended to be used in production.

If you include the index.js within your prototype’s body element (<script src="https://unpkg.com/@stackoverflow/stacks-icons"></script>) you can render Stacks Icons in the browser using only the following format:

<svg data-icon="FaceMindBlown" class="native"></svg>

This package looks out for elements that look like svg[data-icon]. If the icon doesn’t exist in Stacks, it will throw you an error in console. Anything in the class="" attribute will be passed to the included SVG e.g., native

Regex for replacing with @Svg helper

This might be useful if you want to convert a large prototype to use the Razor helper.

Find

<svg data-icon="(.+?)" class="(.+?)"></svg>

Replace

@Svg.$1.With("$2")

Use as a JavaScript module

import Icons from "stacks-icons";

console.log(Icons.FaceMindBlown);

// Returns <svg>...</svg>

FAQs

Package last updated on 20 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc